from app.utils import feed_handler
from time import mktime
from datetime import datetime


def hot():
    # 煎蛋
    # id = 3
    url = 'http://jandan.net/feed'
    agent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36 Edg/80.0.361.57'
    import feedparser
    file = feedparser.parse(url, agent=agent)
    return file


if __name__ == '__main__':
    a = hot()
    thistime = a['entries'][0]['published_parsed']
    dt = datetime.fromtimestamp(mktime(thistime))
    print(dt)
    print(type(dt))
